home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / png / zlib09 / inftrees.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  2.5 KB  |  63 lines

  1. /* inftrees.h -- header to use inftrees.c
  2.  * Copyright (C) 1995 Mark Adler
  3.  * For conditions of distribution and use, see copyright notice in zlib.h 
  4.  */
  5.  
  6. /* WARNING: this file should *not* be used by applications. It is
  7.    part of the implementation of the compression library and is
  8.    subject to change. Applications should only use zlib.h.
  9.  */
  10.  
  11. /* Huffman code lookup table entry--this entry is four bytes for machines
  12.    that have 16-bit pointers (e.g. PC's in the small or medium model).
  13.    Valid extra bits (exop) are 0..13.  exop == -64 is EOB (end of block),
  14.    exop == 16 means that v is a literal, exop < 0 means that v is a pointer
  15.    to the next table, which codes -exop bits, and lastly exop == -128
  16.    indicates an unused code.  If a code with exop == -128 is looked up,
  17.    this implies an error in the data. */
  18.  
  19. typedef struct inflate_huft_s inflate_huft;
  20. struct inflate_huft_s {
  21.   union {
  22.     struct {
  23.       char Exop;        /* number of extra bits or operation */
  24.       char Bits;        /* number of bits in this code or subcode */
  25.     } what;
  26.     Byte *pad;          /* pad structure to a power of 2 (4 bytes for */
  27.   } word;               /*  16-bit, 8 bytes for 32-bit machines) */
  28.   union {
  29.     uInt Base;          /* literal, length base, or distance base */
  30.     inflate_huft *Next; /* pointer to next level of table */
  31.   } more;
  32. };
  33.  
  34. #ifdef DEBUG
  35.   extern uInt inflate_hufts;
  36. #endif
  37.  
  38. extern int inflate_trees_bits __P((
  39.     uInt *,            /* 19 code lengths */
  40.     uInt *,            /* bits tree desired/actual depth */
  41.     inflate_huft **,        /* bits tree result */
  42.     z_stream *));        /* for zalloc, zfree functions */
  43.  
  44. extern int inflate_trees_dynamic __P((
  45.     uInt,            /* number of literal/length codes */
  46.     uInt,            /* number of distance codes */
  47.     uInt *,            /* that many (total) code lengths */
  48.     uInt *,            /* literal desired/actual bit depth */
  49.     uInt *,            /* distance desired/actual bit depth */
  50.     inflate_huft **,        /* literal/length tree result */
  51.     inflate_huft **,        /* distance tree result */
  52.     z_stream *));        /* for zalloc, zfree functions */
  53.  
  54. extern int inflate_trees_fixed __P((
  55.     uInt *,            /* literal desired/actual bit depth */
  56.     uInt *,            /* distance desired/actual bit depth */
  57.     inflate_huft **,        /* literal/length tree result */
  58.     inflate_huft **));        /* distance tree result */
  59.  
  60. extern int inflate_trees_free __P((
  61.     inflate_huft *,        /* tables to free */
  62.     z_stream *));        /* for zfree function */
  63.